<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>worker</title>
</head>

<body>
  <script>
    // 在页面中加载项目内部js文件创建工作者线程
    const worker = new Worker('./worker.js')
    // console.log(worker);
    worker.postMessage('你好')
  </script>
</body>

</html>